package com.cgw.dmplt.room.biz.impl;

import com.cgw.dmplt.room.biz.RoomBiz;
import com.cgw.dmplt.room.dao.BuildingDao;
import com.cgw.dmplt.room.dao.RoomDao;
import com.cgw.dmplt.room.domain.Building;
import com.cgw.dmplt.room.domain.Room;

public class RoomBizImpl implements RoomBiz {

	private RoomDao roomDao;
	private BuildingDao buildDao;
	
	public Room findRoom(Integer pk, boolean needBuild) {
		Room room=roomDao.findRoom(pk);
		if(room!=null && needBuild){
			Building build=buildDao.findBuilding(room.getBuildId());
			room.setBuild(build);
		}
		return room;
	}

	public RoomDao getRoomDao() {
		return this.roomDao;
	}

	public void setRoomDao(RoomDao roomDao) {
		this.roomDao = roomDao;
	}

	public BuildingDao getBuildDao() {
		return this.buildDao;
	}

	public void setBuildDao(BuildingDao buildDao) {
		this.buildDao = buildDao;
	}
}
